/**
 * Created by Administrator on 2017/4/20.
 */
var type = 2;
$(function () {

    var key = getCookie('key');
    var agent = getQueryString('agent');
    if (!key) {
        window.location.href = WapSiteUrl + '/tmpl/member/login.html';
    }
    function initPage() {
        $.ajax({
            type: 'get',
            url: ApiUrl + "/index.php?act=member_index&op=agent_info",
            data: {key: key,agent_id:agent},
            dataType: 'json',
            success: function (result) {
                if(result.datas['data']['agent']['id']) {
                    var discuss = template.render('agent_info', result.datas);
                    $('#agent').html(discuss);
                }else{
                    $.sDialog({
                        skin:"red",
                        content:"代理商不存在",
                        okBtn:true,
                        cancelBtn:true,
                    });
                }
            }
        });
    }

    initPage();
});